﻿using JumpstartApp.Helpers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace JumpstartApp.Controls
{
    public sealed partial class Silhouette : UserControl
    {
        public Silhouette() { this.InitializeComponent(); }

        public string Title
        {
            get { return (string)GetValue(TitleProperty); }
            set { SetValue(TitleProperty, value); }
        }
        public static readonly DependencyProperty TitleProperty =
            DependencyProperty.Register("Title", typeof(string), typeof(Silhouette),
            new PropertyMetadata(string.Empty, OnTitlePropertyChanged));
        private static void OnTitlePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as Silhouette).TitleText.Text = e.NewValue.ToString();
        }

        public string SubTitle
        {
            get { return (string)GetValue(SubTitleProperty); }
            set { SetValue(SubTitleProperty, value); }
        }
        public static readonly DependencyProperty SubTitleProperty =
            DependencyProperty.Register("SubTitle", typeof(string), typeof(Silhouette),
            new PropertyMetadata(string.Empty, OnSubTitlePropertyChanged));
        private static void OnSubTitlePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as Silhouette).SubTitleText.Text = e.NewValue.ToString();
        }

        public bool ShowGuide
        {
            get { return (bool)GetValue(ShowGuideProperty); }
            set { SetValue(ShowGuideProperty, value); }
        }
        public static readonly DependencyProperty ShowGuideProperty =
            DependencyProperty.Register("ShowGuide", typeof(bool), typeof(Silhouette),
            new PropertyMetadata(false, OnShowGuidePropertyChanged));
        private static void OnShowGuidePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as Silhouette).MySilhouette.Visibility = ((bool)e.NewValue) ? Visibility.Visible : Visibility.Collapsed;
        }
    }
}
